package com.xy.job.admin.api.request

import com.xy.job.admin.domain.JobExtendConfig
import com.xy.job.admin.enums.ExecuteMode
import com.xy.job.admin.enums.ScheduleType
import com.xy.job.core.enums.JobType
import com.xy.job.core.enums.ScriptType
import jakarta.persistence.Column
import jakarta.persistence.EnumType
import jakarta.persistence.Enumerated
import jakarta.validation.constraints.NotBlank
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Positive

class JobInfoAddParam(
    /**
     * 应用分组
     */
    @NotBlank
    var groupCode: String? = null,
    /**
     * 任务名称
     */
    @NotBlank
    var jobName: String? = null,
    /**
     * 任务描述
     */
    var jobDesc: String? = null,
    /**
     * 调度类型
     */
    @NotNull
    var scheduleType: ScheduleType? = null,
    /**
     * 调度配置
     */
    @NotBlank
    var scheduleConfig: String? = null,
    /**
     * 任务类型
     */
    @NotNull
    var jobType: JobType? = null,
    /**
     * 任务处理器
     */
    @NotBlank
    var jobHandler: String? = null,
    /**
     * 执行模式
     */
    @NotNull
    var executeMode: ExecuteMode? = ExecuteMode.SINGLE,
    /**
     * 执行参数
     */
    var executeParams: String? = null,
    /**
     * 最大实例并发数
     */
    @Positive
    var maxConcurrentNum: Int = 1,
    /**
     * 脚本类型
     */
    @Enumerated(EnumType.STRING)
    @Column(name = "script_type")
    var scriptType: ScriptType? = null,
    /**
     * 脚本源代码
     */
    @Column(name = "script_code")
    var scriptCode: String? = null,
    /**
     * 扩展配置项
     */
    @NotNull
    var extendConfig: JobExtendConfig? = null,
)